<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绿能智链 - 电力兑换</title>
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: #f8faf9;
            color: #333;
            min-height: 100vh;
        }
        .status-bar {
            height: 44px;
            background-color: #000;
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            font-size: 14px;
            font-weight: 600;
        }
        .app-header {
            background: linear-gradient(135deg, #1a8754, #0d6e3d);
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .tab-bar {
            background-color: white;
            border-top: 1px solid #e5e7eb;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
        }
        .tab-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 8px 0;
            color: #6b7280;
        }
        .tab-item.active {
            color: #10b981;
        }
        .content-area {
            min-height: calc(100vh - 44px - 60px);
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding-bottom: 20px;
        }
        .map-container {
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }
        .exchange-card {
            background: white;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 4px 8px rgba(0,0,0,0.08);
        }
        .transaction-item {
            border-bottom: 1px solid #f0f0f0;
            transition: all 0.2s ease;
        }
        .transaction-item:last-child {
            border-bottom: none;
        }
        .transaction-item:hover {
            background-color: #f9fafb;
        }
        .input-field {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 10px 12px;
            width: 100%;
            transition: all 0.3s ease;
        }
        .input-field:focus {
            border-color: #10b981;
            box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
            outline: none;
        }
        .location-marker {
            width: 16px;
            height: 16px;
            background-color: #10b981;
            border-radius: 50%;
            border: 3px solid rgba(16, 185, 129, 0.3);
            position: absolute;
            transform: translate(-50%, -50%);
        }
        .location-marker.active {
            background-color: #047857;
            border-color: rgba(4, 120, 87, 0.3);
        }
        .location-marker::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 30px;
            height: 30px;
            background-color: rgba(16, 185, 129, 0.2);
            border-radius: 50%;
            animation: pulse 2s infinite;
        }
        @keyframes pulse {
            0% {
                transform: translate(-50%, -50%) scale(0.5);
                opacity: 1;
            }
            100% {
                transform: translate(-50%, -50%) scale(1.5);
                opacity: 0;
            }
        }
    </style>
</head>
<body class="flex flex-col h-full">
    <!-- iOS状态栏 -->
    <div class="status-bar">
        <div>9:41</div>
        <div class="flex space-x-2">
            <i class="fas fa-signal"></i>
            <i class="fas fa-wifi"></i>
            <i class="fas fa-battery-full"></i>
        </div>
    </div>

    <!-- 应用头部 -->
    <header class="app-header p-4 text-white relative">
        <div class="flex justify-between items-center">
            <h1 class="text-xl font-bold">电力兑换</h1>
            <div class="flex space-x-4">
                <button>
                    <i class="fas fa-question-circle"></i>
                </button>
                <button>
                    <i class="fas fa-history"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- 主内容区域 -->
    <div class="content-area flex-1 p-4 relative">
        <!-- 兑换表单 -->
        <section class="mb-6">
            <div class="exchange-card p-4">
                <h2 class="text-lg font-semibold mb-4">兑换电力</h2>
                <div class="mb-4">
                    <label class="block text-sm font-medium text-gray-700 mb-2">选择NFT资产</label>
                    <select class="input-field">
                        <option>青海湖风力发电站 (可用: 750 kWh)</option>
                        <option>张北坝上风力发电站 (可用: 200 kWh)</option>
                    </select>
                </div>
                <div class="mb-4">
                    <label class="block text-sm font-medium text-gray-700 mb-2">兑换电量</label>
                    <div class="flex items-center">
                        <input type="text" value="100" class="input-field">
                        <span class="ml-2 text-gray-600">kWh</span>
                    </div>
                    <div class="flex justify-between mt-1">
                        <button class="text-xs text-green-600">最小值</button>
                        <button class="text-xs text-green-600">最大值</button>
                    </div>
                </div>
                <div class="mb-4">
                    <label class="block text-sm font-medium text-gray-700 mb-2">关联用电账户</label>
                    <input type="text" placeholder="输入家庭/企业用电账号" class="input-field">
                </div>
                <div class="mb-4">
                    <label class="block text-sm font-medium text-gray-700 mb-2">兑换方式</label>
                    <div class="flex space-x-2">
                        <button class="flex-1 py-2 bg-green-600 text-white rounded-lg flex items-center justify-center">
                            <i class="fas fa-bolt mr-1"></i> 直接用电
                        </button>
                        <button class="flex-1 py-2 bg-gray-200 text-gray-700 rounded-lg flex items-center justify-center">
                            <i class="fas fa-coins mr-1"></i> 兑换积分
                        </button>
                    </div>
                </div>
                <button class="w-full bg-green-600 text-white py-3 rounded-lg font-medium hover:bg-green-700 transition">
                    确认兑换
                </button>
            </div>
        </section>

        <!-- 地图显示 -->
        <section class="mb-6">
            <h2 class="text-lg font-semibold mb-3">就近电网接入点</h2>
            <div class="map-container h-48 relative">
                <img src="https://images.unsplash.com/photo-1524661135-423995f22d0b?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80" alt="地图" class="w-full h-full object-cover">
                <!-- 电网接入点标记 -->
                <div class="location-marker active" style="top: 30%; left: 40%;"></div>
                <div class="location-marker" style="top: 60%; left: 70%;"></div>
                <div class="location-marker" style="top: 45%; left: 20%;"></div>
                <!-- 当前位置标记 -->
                <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-8 h-8 bg-blue-500 rounded-full border-4 border-white flex items-center justify-center text-white">
                    <i class="fas fa-user-alt text-xs"></i>
                </div>
                <!-- 控制按钮 -->
                <div class="absolute bottom-3 right-3 flex space-x-2">
                    <button class="w-8 h-8 bg-white rounded-full shadow flex items-center justify-center">
                        <i class="fas fa-plus text-gray-700"></i>
                    </button>
                    <button class="w-8 h-8 bg-white rounded-full shadow flex items-center justify-center">
                        <i class="fas fa-minus text-gray-700"></i>
                    </button>
                </div>
            </div>
            <div class="mt-2 text-sm text-gray-600">
                <i class="fas fa-info-circle mr-1"></i> 已为您选择最近的电网接入点，距离您 2.5 公里
            </div>
        </section>

        <!-- 交易记录 -->
        <section class="mb-6">
            <div class="flex justify-between items-center mb-3">
                <h2 class="text-lg font-semibold">历史兑换记录</h2>
                <button class="text-green-600 text-sm">
                    查看全部
                </button>
            </div>
            <div class="exchange-card">
                <div class="transaction-item p-4">
                    <div class="flex justify-between items-center">
                        <div>
                            <div class="font-medium">青海湖风力发电站</div>
                            <div class="text-sm text-gray-600 mt-1">兑换电量: 100 kWh</div>
                        </div>
                        <div class="text-right">
                            <div class="text-green-600 font-medium">已完成</div>
                            <div class="text-xs text-gray-500 mt-1">2023-10-15</div>
                        </div>
                    </div>
                </div>
                <div class="transaction-item p-4">
                    <div class="flex justify-between items-center">
                        <div>
                            <div class="font-medium">张北坝上风力发电站</div>
                            <div class="text-sm text-gray-600 mt-1">兑换电量: 200 kWh</div>
                        </div>
                        <div class="text-right">
                            <div class="text-green-600 font-medium">已完成</div>
                            <div class="text-xs text-gray-500 mt-1">2023-10-02</div>
                        </div>
                    </div>
                </div>
                <div class="transaction-item p-4">
                    <div class="flex justify-between items-center">
                        <div>
                            <div class="font-medium">青海湖风力发电站</div>
                            <div class="text-sm text-gray-600 mt-1">兑换电量: 150 kWh</div>
                        </div>
                        <div class="text-right">
                            <div class="text-green-600 font-medium">已完成</div>
                            <div class="text-xs text-gray-500 mt-1">2023-09-18</div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>

    <!-- 底部Tab栏 -->
    <div class="tab-bar h-16 flex justify-around items-center">
        <a href="home.html" class="tab-item">
            <i class="fas fa-home text-xl"></i>
            <span class="text-xs mt-1">首页</span>
        </a>
        <a href="nft_detail.html" class="tab-item">
            <i class="fas fa-store text-xl"></i>
            <span class="text-xs mt-1">市场</span>
        </a>
        <a href="wallet.html" class="tab-item">
            <i class="fas fa-solar-panel text-xl"></i>
            <span class="text-xs mt-1">我的资产</span>
        </a>
        <a href="exchange.html" class="tab-item active">
            <i class="fas fa-exchange-alt text-xl"></i>
            <span class="text-xs mt-1">兑换</span>
        </a>
    </div>
</body>
</html>